import http from "../utils/request"

//文件上传 /admin/resource/uploadQiNiu
const uploadFile = (data) => {
    return http.request({
        url: "/admin/resource/uploadQiNiu",
        method: 'post',
        data: data,
        contentType: "form-data"
    })
}

//背景图列表 /admin/resource/backgroundImage/page
const bgImagePage = (data) => {
    return http.request({
        url: "/admin/resource/backgroundImage/page",
        method: "get",
        data: data
    })
}

//背景图新增 /admin/resource/backgroundImage/add
const bgImageAdd = (data) => {
    return http.request({
        url: "/admin/resource/backgroundImage/add",
        method: "post",
        data: data
    })
}

//校验图片 /admin/resource/backgroundImage/checkImage
const checkImage = (data) => {
    return http.request({
        url: "/admin/resource/backgroundImage/checkImage",
        method: "get",
        data: data
    })
}

//删除背景图 /admin/resource/backgroundImage/{id}
const bgImageDelete = (data) => {
    return http.request({
        url: "/admin/resource/backgroundImage/" + data.id,
        method: "delete",
        data: data
    })
}

export {
    uploadFile,
    bgImageAdd,
    bgImagePage,
    bgImageDelete,
    checkImage
}
